﻿<UserControl xmlns:my="http://schemas.awesomium.com/winfx"  x:Class="MusicExplorer.View.Player"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="clr-namespace:MusicExplorer.Resources.Control"
             xmlns:internals="clr-namespace:MusicExplorer.Internals"
             HorizontalAlignment="Stretch" DataContext="{Binding Player}"
             >
    
    <UserControl.Resources>
        <ResourceDictionary>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Skins/PlayerSkin.xaml" />
                <ResourceDictionary Source="../Resources/Skins/SliderSkin.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Border BorderThickness="0, 0, 0, 1" Style="{StaticResource PlayerPanelBorder}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <!-- Browser -->

            
            <TextBlock Text="MusicExplorer" FontSize="30" FontFamily="Helvetica" FontWeight="SemiBold" VerticalAlignment="Center"
                       Margin="10, 0, 0, 0">
                <TextBlock.Foreground>
                    <SolidColorBrush>
                        <SolidColorBrush.Color>
                            <Color A="100" R="0" G="0" B="0" />
                        </SolidColorBrush.Color>
                    </SolidColorBrush>
                </TextBlock.Foreground>
            </TextBlock>

            <Grid HorizontalAlignment="Center" Width="Auto">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="25" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding DisplayNamePlayedTrack}" Grid.Column="1"
                           TextAlignment="Center" VerticalAlignment="Bottom"
                           MaxWidth="500" FontFamily="Helvetica" FontWeight="SemiBold" FontSize="13" Margin="0, 5, 0, 0" />
                <controls:LoadingTreeviewIndicator Grid.Row="1" Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}"
                                                   VerticalAlignment="Center" Width="16" Margin="0, 3, 0, 0"/>
                <Slider Grid.Column="1" Grid.Row="1" Value="0" Focusable="False" Width="500" PreviewMouseLeftButtonDown="GoToPosition"
                        Maximum="{Binding Mp3Length}" VerticalAlignment="Center" />
                <Image Source="{Binding CurrentImage}" Grid.RowSpan="2" Grid.Column="2" Width="45" Height="45"
                       Margin="15, 0, 0, 0"/>

            </Grid>

            <my:WebControl internals:WebControlUtility.Html="{Binding WebControlHtml}" DocumentReady="WebControlReady" x:Name="webControl" />
        </Grid>
    </Border>
</UserControl>
